/**
 * 采退管理
 */
import { postRequest, getRequest, getDownload, uploadRequest } from '@/lib/axios'

export const withdrawalApi = {
  // 采退订单

  // 采退订单分页查询 @author zhuoda
  queryList: (params) => {
    return getRequest('/purchase/list', params)
  },
  // 历史订单
  historyList: (params) => {
    return getRequest('/purchase/history', params)
  },
  // 详情
  detail: (params) => {
    return getRequest('/purchase/detail', params)
  },
  // 新增
  create: (data) => {
    return postRequest('/purchase/add', data)
  },
  // 编辑
  edit: (data) => {
    return postRequest('/purchase/edit', data)
  },
  // 修改
  modify: (data) => {
    return postRequest('/purchase/modify', data)
  },
  // 删除
  del: (data) => {
    return postRequest('/purchase/del', data)
  },
  // 导出
  exportXlsx: (params) => {
    return getDownload('/purchase/exportXlsx', params)
  },
  // 下载模版
  exportTpl: (params) => {
    return getDownload('/purchase/exportTpl', params)
  },
  // 导入
  importXlsx: (data) => {
    return uploadRequest('/purchase/importXlsx', data)
  }
}
